package bdlocale;



import javax.media.Player;
import javax.swing.JFileChooser;
import javax.swing.JFrame;
import java.net.*;

class Sipmle_Player {

	public static void main(String [] args) {
		
		JFileChooser chooser = new JFileChooser();
		int option = chooser.showOpenDialog(null);
		if(option == JFileChooser.APPROVE_OPTION) {
			try {
				
				URL url = chooser.getSelectedFile().toURL();
				creatANDSHOWGUI(url);
				
			}catch(MalformedURLException ex){
				System.out.println("The url was malformed");
                                
				
			}
			
			} // end main
		
	}
		public static void creatANDSHOWGUI(URL url){
			
		SimplePalyer simpleplayer = new SimplePalyer("simple media player app", url);
		simpleplayer.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		simpleplayer.setSize(300,400);
		simpleplayer.setVisible(true);
		}
		
	}

